package callbackmechanism;

import java.util.List;

public class Rebot {

	/**
	 * @throws InterruptedException 
	* @Title: filterObj 
	* @Description: TODO(过滤物品) 
	* @param @param list
	* @param @param callBack    回调
	* @return void    返回类型 
	* @throws
	 */
	public void filterObj(List<String> list, CallBack callBack) throws InterruptedException {
		int index = 0;
		for (String obj : list) {
			Thread.sleep(1000);
			index ++;
			if(obj.equals("苹果")) {
				callBack.call(obj,index);
				break;
			}
		}
	};
}
